from django.utils.deprecation import MiddlewareMixin


class TestMiddleware(MiddlewareMixin):
    def process_request(self,request):
        jdata=request.body
        jdata=jdata.decode('utf8')
        print(f"请求前的数据"+jdata)


    def process_response(self, request, response):
        print("响应前的数据"+response.content.decode('utf-8'))